<%--
*
* 描述：模块表SYSTEM_MODULE的list文件列表
* 
* @author tch  
*
--%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="g" uri="/fishergrid-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <title><s:property value="operate"/>模块列表</title>
	<%@include file="/share/header.jsp"%>
	<s:head/>	
	<g:header theme="${sessionScope.skinCon.gridSkin}"/>	
  </head>
  <body>
	<script type="text/javascript">
		//新增
		function onDoAdd(name,g){
			var options={
				title:'【新增模块配置】',
				url:'<s:url action='new' namespace='/system/moduleconfig'/>',
				source : window,
				buttons:[top.MyWindow.Save,top.MyWindow.Cancel],
				multiplewidth:1,
				multipleheight:1.01
			};
			top.MyWindow.open(options);
		}
		//修改		
		function onDoOperateRenderer(tdDiv,pid){
			var editOptions={
				title:'【修改模块配置】',
				url:'<s:url action="edit" namespace='/system/moduleconfig'/>?domain.id='+getIndex(pid,1),
				source : window,
				buttons:[top.MyWindow.Save,top.MyWindow.Cancel],
				multiplewidth:1,
				multipleheight:1.01
			};
			 var url = "";
			 if(getIndex(pid,2)==0)
			 {
			 	url = '<s:url action='new' namespace='/system/moduleconfig'/>?domain.parentId='+getIndex(pid,1);
			 }
			 else
			 {
			 	url = '<s:url action='new' namespace='/system/moduleconfig'/>?domain.parentId='+getIndex(pid,2);
			 }
			var addOptions={
				title:'【新增模块配置】',
				url:url,
				source : window,
				buttons:[top.MyWindow.Save,top.MyWindow.Cancel],
				multiplewidth:1,
				multipleheight:1.01
			};			
			var edtihtml='<a href="javascript:void(0);" title="修改">修改</a>';
			var addhtml='<a href="javascript:void(0);" title="新增下级模块">新增下级模块</a>';
			$(tdDiv).html("");//去除原有的内容
			$(tdDiv).append($(edtihtml).click(function(){//添加链接
											top.MyWindow.open(editOptions);
										})
							);
			$(tdDiv).append(" / ");							
			$(tdDiv).append($(addhtml).click(function(){//添加链接
											top.MyWindow.open(addOptions);
										})
							);		
							
		}	
		//新增下级模块		
		function onDoParentNameRenderer(tdDiv,pid){
			var options={
				title:'【新增下级模块配置】',
				url:'<s:url action="new" namespace='/system/moduleconfig'/>?domain.parentId='+getIndex(pid,2),
				source : window,
				buttons:[top.MyWindow.Save,top.MyWindow.Cancel],
				multiplewidth:1,
				multipleheight:1.01,
				tipstitle:'注意说明:',
				tipscontent:'<br>1.模块路径对于叶子节点模块有效，分支节点模块不用设置;<br>2.桌面统计信息对于需要实现桌面统计的叶子节点模块有效;<br>3.统计查询字段和统计查询值按照FisherGrid的规则，使用#表示逻辑与条件，_表示逻辑与;<br>4.统计动态字段和统计动态值按照FisherGrid的规则，使用#分隔多个字段;<br>5.统计查询值使用{scope}占位桌面统计过滤类型中的内容，统计时自动动态替换; '
			};			
			var addhtml='<a href="javascript:void(0);" title="新增【'+$(tdDiv).html()+'】下级模块">'+$(tdDiv).html()+'</a>';
			$(tdDiv).html("");//去除原有的内容
			$(tdDiv).append($(addhtml).click(function(){//添加链接
											top.MyWindow.open(options);
										})
							);				
		}			
		//查看		
		function onDoNameRenderer(tdDiv,pid){
			var options={
				title:'【查看模块配置】',
				url:'<s:url action="view" namespace='/system/moduleconfig'/>?readonly=true&domain.id='+getIndex(pid,1),
				source : window,
				buttons:[top.MyWindow.Close],
				multiplewidth:1,
				multipleheight:1,
				tipstitle:'',
				tipscontent:''
			};			
			var viewhtml='<a href="javascript:void(0);" title="查看【'+$(tdDiv).html()+'】详细信息">'+$(tdDiv).html()+'</a>';
			$(tdDiv).html("");//去除原有的内容
			$(tdDiv).append($(viewhtml).click(function(){//添加链接
											top.MyWindow.open(options);
										})
							);				
		}		
		//删除
		function onDoDelete(name,grid){
			onDoAjax({url:'<s:url action='deletes' namespace='/system/moduleconfig'></s:url>',index:1});
		}	
		//启用
		function onDoEnable(name,grid){
			onDoAjax({url:'<s:url action='changes' namespace='/system/moduleconfig'></s:url>?domain.state=1',tip:'启用',index:1});
		}
		//停用
		function onDoUnEnable(name,grid){
			onDoAjax({url:'<s:url action='changes' namespace='/system/moduleconfig'></s:url>?domain.state=2',tip:'停用',index:1});
		}
		//复制
		function onDoCopy(name,grid){
			onDoAjax({url:'<s:url action='copys' namespace='/system/moduleconfig'></s:url>?copyName=name',tip:'复制',index:1});
		}										
	</script>  
  	<s:actionerror/>
  	<g:grid title="模块配置列表" name="/system/moduleconfig/module_config.fisher.xml">
  		<g:select/>
  		<g:separator/>
  		<g:button name="新增" styleClass="fisherAdd" onclick="onDoAdd"/>
  		<g:separator/>  
  		<g:button name="复制" styleClass="fisherCopy" onclick="onDoCopy"/>
  		<g:separator/> 
		<s:if test="isSuperAdministrator()">  		  		  		 
  		<g:button name="删除" styleClass="fisherDelete" onclick="onDoDelete"/>
  		<g:separator/>  
  		</s:if>	  		 				
  		<g:query/>
  		<g:separator/>
  		<g:export/>  		
  	</g:grid>
  </body>
</html>
